<nav class="navbar navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>

</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <?php
    require_once('system/dbConn.php');
    connect();
    $sql="select * from videotype";
    $rs=mysql_query($sql)or die('查询 1 失败！'.mysql_error());
    ?>
    <ul class="nav navbar-nav">
        <li><a href="index.php">首页<span class="sr-only">(current)</span></a></li>
        <li><a href="list.php">电视剧</a></li>
        <li><a href="list.php">电影</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">更多<span class="caret"></span></a>
          <ul class="dropdown-menu">
        <?php
        while($row=mysql_fetch_assoc($rs))
        {
            ?>
            <li><a href="list.php?tid=<?php
                echo $row["tid"];
                ?>
                "><?php
                echo $row["typename"];
                ?>
            </a></li>
            <?php
        }
        ?>
    </ul>
</li>
</ul>
<form action="search.php" class="navbar-form navbar-left" role="search" >
    <div class="form-group">
        <input type="text" class="form-control" name="videoname"
        placeholder="Search">
    </div>
    <button type="submit" class="btn btn-default">搜索</button>
</form>
<ul class="nav navbar-nav navbar-right">
    <li class="active"><a href="">欢迎<?php
        session_start();
        if(isset($_SESSION["user"]))
            echo " ".$_SESSION["user"]." ";
        else{
            echo "您";
        }
        ?>访问本网站</a>
    </li>
    <?php
//登录成功才显示
    if(isset($_SESSION["user"]))
    {
        ?>
        <li><a href="logout.php">注销</a></li>
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
            aria-haspopup="true" aria-expanded="false">个人中心 <span class="caret"></span></a>
            <ul class="dropdown-menu">
                <li><a href="#" data-toggle="modal" data-target="#changePassword">修改个人密码
                </a></li>
                <li><a href="#" data-toggle="modal" data-target="#changeInfor">修改个人信息
                </a></li>
                <li><a href="myCommentList.php" data-toggle="modal" data-target="#comment" >我的评价</a></li>
            </ul>
        </li>
        <?php
    }else{
        ?>
        <li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>
        <li><a href="#" data-toggle="modal" data-target="#reg">注册</a></li>
        <?php
    }
    ?>
</ul>
     
</div>
</div>
</nav>